#include "Shape.h"
#include "Circle.h"
#include "Rect.h"

Shape::Shape(colour colour)
	:m_colour(colour) {};

Shape::Shape(const Shape& other)
	:m_colour(other.m_colour){}

//double Shape::Get_area()const
//{
//	if (typeid(*this) == typeid(Circle))
//	{
//		Circle::Get_area;
//	}
//
//	if (typeid(*this) == typeid(Rect))
//	{
//		Rect::Get_area;
//	}
//}
//
//
//double Shape::Get_distance()const
//{
//	if (typeid(*this) == typeid(Circle))
//	{
//		Circle::Get_distance;
//	}
//
//	if (typeid(*this) == typeid(Rect))
//	{
//		Rect::Get_distance;
//	}
//}

double Shape::Get_colour() const
{
	return static_cast<double>(m_colour);
}

Shape& Shape::operator=(const Shape& other)
{
	m_colour = other.m_colour;
	return *this;
}

bool Shape::operator==(const Shape& other) const
{
	if(m_colour!= other.m_colour){ return false; }
	else { return true; }
}

std::ostream& operator<<(std::ostream& os, const Shape& shape)
{
	static const char* arr[]{ "RED", "GREEN", "BLUE", "BLACK" };
	os << "colour: " << shape.m_colour << " (" <<arr[shape.m_colour]<<")";
	return os;
}
